<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>test 标题测试 </title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/social-share.js/1.0.16/css/share.min.css">
</head>

<body>
    <style>
.tab_img{
    width:100%;
    font-size: 16px;
    color: red;
}

.plent .Your{
    position: absolute;
    top: 14%;
    right: 31%;
    font-size: 4.2vw;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #222222;
    line-height:5.8vw;
    

}
.plent .Your span{
    font-size: 3.2vw;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #666666;
}
.plent{
    position: relative;
    position: absolute;
top: 34%;
}
.num{
    position: absolute;
    top: 20%;
    font-size: 12.8vw;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #DF5B0F;
    line-height: 17.8vw;
    right: 39%;


}
.people div{
    font-size: 2.6vw;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #999999;
    line-height: 3.7vw;
}
.num img{
    width:8.8vw;
    height:9.8vw  

}
.tab_img{
    position: relative;
}
.people{
            position: absolute;
            top: 45%;
            right: 24%;
}
.Pel{
    position: absolute;
    top: 74%;
    right: 33%;
   
}
.lentr{
    position:absolute;
    position: absolute;
    top: 56%;
}
.Pel div{
    font-size: 4.8vw;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #951F1F;
    line-height:6.6vw;
}

*{
  margin:0;
  padding:0;
 }
 .wrap{
    /* margin-left: 50px; */
    /* margin-top: 50px; */
    position: absolute;
    top: 6%;
    left: 21%;
 }
 /*清浮动---clearfix*/
 .clearfix {
  *zoom: 1;
 }
 .clearfix:after {
  content: "";
  clear: both;
  display: block;
  height: 0;
  font-size: 0;
  visibility: hidden;
 }
 .blist {
 
    width: 77vw;
    height: 32px;
    display: flex;
    flex-flow: row;
    justify-content: space-between;
 }
 .blist li:first-child{
  border-left: none;
 }
 .blist li{
  list-style: none;
  /* width: 68px;
  height: 32px; */
   font-size: 4.8vw;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #656565;
    line-height:6.6vw;
 
 
  text-align: center;
  /* float: left; */
  /*鼠标样式改变为一个手*/
  cursor: pointer;
  /*字体免选中*/
  -webkit-user-select: none;
  
 }
 .blsit-list{
    width: 77vw;
    position: absolute;
    left: -10%;
    height: 76vw;
    /* border: 1px solid red; */
    overflow: scroll;

 }
 .blsit-list li{
  list-style: none;
  width: 77vw;
 
  height: 200px;
  border-top: none;
 }
 .wrap .blist li.active{
  font-weight: bold;
  color: red;
  border-bottom: 2px solid red;
  position: relative;
 
  top:-1px;
  height: 31px;
 }
 .blsit-list li:first-child{
  display: block;
 }
 .blsit-list li{
  display: none;
 }
 .blsit-list li{
     margin-top: 2vw;
   
 }
 .tab_img .Grils{
      width:11.2vw;
      height:11.2vw
  }
  .tab_img .icon_tab{
     width:4.2vw;
     height:4.8vw;
     padding-left: 1.6vw;
  }
 .data_p{
     padding-top: 1.0vw;
     font-size:3.2vw;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #666666;
    line-height:4.5vw;
 }
 .data_ter{
    font-size: 3.7vw;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #222222;
    line-height:5.3vw;
 }
 .Plog{
    position: absolute;
    top: 24%;
    left: 39%;
 }
 .Sour{
     display: flex;
     padding-left: 8vw
 }
 .Num_to{
    color: #FFFFFF;
    padding-right: 2vw;
 }
 .plty{
    color: #FFFFFF;
    font-size: 3.2vw;
    padding-top: 2vw;
 }
 .btn{
    display: flex;flex-wrap: wrap;justify-content: space-between;margin-bottom: 7.4vw;
    margin-right: 7vw;
    
 }
 .tab_bg{
    padding-left: 2vw; 
 }
 .sen_bg{
     display: flex; 
 }
 .mack_ni{
     display: flex;margin-top:3vw; 
 }
 .Wen_zi{
    font-size: 3.7vw;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #2C2C2C;
    margin-top:3.7vw ;
 }
 .Wen_zi div p{
    font-size: 3.7vw;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #656565;
 }
 .shat p{
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #656565;
    margin-top: 1.6vw;
 }
</style>
         
    </style>
      
      <div class="tab_sent">
            <div class="tab_img" id="two">
                    <img src="../img/icon_tab.jpg" alt="" style="width:100%">
                    <div class="Plog">
                                 <div class="Sour">
                                    <div class="Num_to">10</div>
                                    <img src="../img/icon_niu.png" alt="" style="width:20px;height:24px">
                                 </div>
                             
                         
                          <div class="plty">邀一位好友获得</div>
                    </div>
                     <div class="plent">
                        <img src="../img//icon_ye.png" alt="" style="width:99.2vw">
                        <div class="Your">你已经获得奖励：<span>(1金牛=1元)</span></div>
                        <div class="plent_two">
                            <div class="num">
                                <span id="Number">0</span> 
                                <img src="../img/icon_niu.png" style="width:20px; height:24px;">
                        </div>
                        
                    </div>
                
                    
                    <div class="people"><div>邀请用户消费投教产品即可获得奖励金</div></div>
                    <div class="Pel">
                            <div id="get_add">点击右上角转发</div>
                    </div>
                     
                    </div>
                    <div class="lentr">
                            <img src="../img/icon_black.png" style="width:97.2vw">
                            <div class="wrap">
                                            <ul class="blist clearfix">
                                            <li class="active">
                                            奖励明细
                                            </li>
                                            <li>奖励规则</li>
                                            
                                            </ul>
                                        <div style="position: relative;">
                                                    <ul class="blsit-list">
                                                                <li id="one">
                                                                    
                                                                </li>
                                                                <li>
                                                                    <div>
                                                                        <h2 class="Wen_zi">一,如何获取奖励</h2>
                                                                        <div class="shat">
                                                                            <p>1、点击分享并邀请好友注册加入斗牛财经，您将获得****；新朋友注册完成后也可邀请其他人并获得****。 </p> 
                                                                            <p>  2、每邀请一个新用户即可获得****，上下不封顶。</p>
                                                                            <p>  3、和您绑定的用户在购买投教产品后，您也将获得***奖励。</p>
                                                                            
                                                                        </div>
                                                                        <h2  class="Wen_zi">二,奖励使用规范</h2>
                                                                        <div class="shat">
                                                                            <p>  1、所得奖励可线下联系客服提现，但不能转赠他人。  </p> 
                                                                            <p> 2、奖励可在【我的】页面【奖励金牛】中查看，已经提现的金牛将会置灰显示。</p>
                                                                            
                                                                        
                                                                        </div>
                                                                    </div>  

                                                                </li>
                                                    
                                                    </ul>
                                        </div>
                                
                             </div>
                            <div style="margin: 0 auto; text-align: center;margin-top: 7.2vw;">
                               <a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.zfxf.douniu&fromcase=40003" target="_self"> <img src="../img/icon_app.png" alt="" style="width:72.2vw;height:17.6vw"> </a>
                            </div>
                      </div>
                           
                   </div>  
                 
            </div>
      </div>
  <script src="../js/jquery.js.js"></script> 
  	
<script src="../js/jquery.3.1min.js"></script>
<script src="../js/share.js"></script>
<script src="../js/md5.js"></script>
<script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>   
<script>
//   var apiUrl = 'https://api.douniu8.com'  
  var apiUrl =  'https://test6.douniu8.com'
  //点击图片跳转下载app
//   $('#pic').click(function(){
//       console.log(1)
     
//       window.location.href='http://a.app.qq.com/o/simple.jsp?pkgname=com.zfxf.douniu&fromcase=40003'
//       sessionStorage.removeItem(token)
//       return false
//   })
 $(function(){
  $(".blist li").on("mouseenter",function(){
   var index = $(this).index();
   $(this).addClass("active").siblings().removeClass("active"); 
   $(this).parents(".wrap").find(".blsit-list li").eq(index).show().siblings().hide();
  })
 })


//转发微信好友
 shareUrl = '';
 shareTitle='';
 $(document).ready(function(){
    var token ='Bearer '+sessionStorage.getItem('token')
    
    // if(!sessionStorage.getItem('token')){
    //     window.location.replace("./index.html?inviteCode="+sessionStorage.getItem('dfCode'));
      
    // }
     console.log(token+"有没有token")
     $.ajax({
        contentType: "application/x-www-form-urlencoded",
      //请求之前token放到header
    beforeSend: function (request) {
        request.setRequestHeader("Authorization", token);
    },
      url:apiUrl+'/unauth/inviteCode/myxj',
      type:'post',
      success:function(res){

        var html="";
        var myxjList=res.data.myxjList;
       var rewardCount=res.data.rewardCount;
       shareUrl =res.data.shareUrl;
       sharetitle =res.data.shareTitle
       dfCode =res.data.dfCode
        sessionStorage.setItem('dfCode',res.data.dfCode)
    //   alert(res.data.dfCode+"------------------------")
       $('#Number').text(rewardCount);
        $.each(myxjList,function(index,value){
                 html+=`
                 <div class="btn" id="Btn">
                                    <div class="sen_bg">
                                          <div><img src=" `+value.userIcon+`" alt=""  class="Grils"></div>
                                          <div class="tab_bg">
                                               <div class="data_ter">`+value.udNickname+`</div>
                                               <div class="data_p">`+value.ubRdate+`</div>
                                          </div>
                                    </div>
                                    <div class="mack_ni">
                                         <div class="Who">`+value.reward+`</div>
                                         <img src="../img/icon_niu.png" alt=""   class="icon_tab"> 
                                    </div>
                    </div>
                  
                 ` 
        })
       
        $('#one').append(html)
        
        //+-------------------------------------------------------------
        var token ='Bearer '+sessionStorage.getItem('token')
        //对url进行编码
        var localUrl = document.location.href.replace(/=/g, '[eq]')//获取页面地址
        console.log(localUrl+"=================")

        var url = window.location.href;//获取页面的url地址
        var index = url.lastIndexOf("\/");//截取已/的url地址
        str = url.substring(0,index+1);//截取
        var setUrl= str+'index.html?inviteCode='+dfCode //获取页面地址+存起来的参数带带到index.html页面,转发出去点击登录要有inviteCode。代表身份。分享当前页面detail不用加参数inviteCode的标识
        console.log(setUrl,"=-=-=-");


        //url传到后台格式
        var Url =localUrl
        
        //这几个参数都是后台从微信公众平台获取到的
        var nonceStr, signature, timestamp, appId, shareUrl;
        $.ajax({
            //后台获取参数接口
            url: apiUrl+"/wx/jssdk/config",
            contentType: "application/json",
            beforeSend: function(request) {
                request.setRequestHeader("Authorization",  token);
            },
            type: 'post',
            data:
            JSON.stringify({
                Url:localUrl,
                token:token,
                appId:"dncjOfficialW",//dncjOfficialW微信公众号的，后台给的
            }),
            
            success: function(data) {
                
                console.log( data.data.wxAppId,"------------------------------")
                wx.config({
                    debug: false, // 默认为false  为true的时候是调试模式，会打印出日志
                    appId:data.data.wxAppId,
                    timestamp:data.data.timestamp,
                    nonceStr: data.data.nonceStr,
                    signature: data.data.signature,
                    jsApiList: [

                        'updateAppMessageShareData',
                        'updateTimelineShareData',
               
                    ],
                    
                });
              
                console.log(111111111+Url)
                sessionStorage.setItem('shareUrl',Url+"?inviteCode="+sessionStorage.getItem('dfCode'));//存url
                console.log(shareUrl+"===")
                console.log(sessionStorage.getItem('dfCode')+"===000")
              
                wx.ready(function() {
                // sessionStorage.getItem('dfCode',res.data.dfCode)
                wx.updateAppMessageShareData({ 
                    title:sharetitle, // 分享标题
                    desc: '邀请好友领福利', // 分享描述+inviteCode
                    link:setUrl, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                    imgUrl:shareUrl, // 分享图标
                
                    success: function () {

                        sessionStorage.removeItem('token')
                        // alert("==="+dfCode)
                        // alert("成功了吗"+imgUrl)
                        // alert(title+'==')
                        // 设置成功
                        console.log("dayin",link)
                    },
                
            })
            
            
            });
            wx.error(function(res){
                // alert("错误error" + JSON.stringify(res));
                // alert("错误error" + JSON.stringify(res));
            })
      

            },
            error: function(err) {
                
            },
        });
      }
  })
});

 
// var url =window.location.href
 
 
 
 
   
</script>

</body>

</html>